import { Body, Controller, Get, Post, Res, Req, Put,Delete} from '@nestjs/common'
import { ProduceService } from '../Service/produce.service'
@Controller('produce')
export class ProduceController {
    constructor(private readonly ProduceService: ProduceService) { }
    @Get()
    getType() {
        return this.ProduceService.gettypelist()
    }
    @Post("/search")
    getProList(@Req() req: Request, @Res() res: Response) {
        console.log(req.body,1111);
        return this.ProduceService.getProList(req, res)
    }
    @Put('/editpro')
    addOrder(@Req() req: Request, @Res() res: Response, @Body() body: any) {
        return this.ProduceService.editpro(req,res,body)
    }
    @Post('/addpro')
    getOrderList(@Req() req: Request, @Res() res: Response, @Body() body: any) {
        return this.ProduceService.addpro(req, res, body)
    }
    @Delete("/delone")
    del(@Req() req: Request, @Res() res: Response,) {
        return this.ProduceService.delpro(req, res)
    }
}